<template>
  <div class="p-2 h-[60vh] flex flex-col">
    <h2 class="text-xl text-zinc-900 dark:text-zinc-200 font-bold mb-2 px-1">
      所有分类
    </h2>
    <ul class="overflow-y-scroll">
      <li
        class="text-lg text-zinc-900 dark:text-zinc-300 px-1 py-1.5 duration-200 dark:active:bg-zinc-900 active:bg-zinc-100"
        v-for="(item, index) of $store.getters.categorys"
        :key="index"
        @click="$emit('onItemClick', item)"
      >
        {{ item.name }}
      </li>
    </ul>
  </div>
</template>

<script setup>
// vue3中推荐给事件进行注册
defineEmits(['onItemClick'])
</script>
